<?php
/**
 * Created by PhpStorm.
 * User: addd
 * Date: 2020/10/13
 * Time: 10:56
 */
namespace App\Admin\Selectable;

use App\Models\Scale;
use Encore\Admin\Facades\Admin;
use Encore\Admin\Grid\Filter;
use Encore\Admin\Grid\Selectable;

class Scales extends Selectable
{
    public $model = Scale::class;

    public function make()
    {

        $this->model()->where('store_id', Admin::user()->store_id);
        $this->column('id');
        $this->column('name','房型');

        $this->filter(function (Filter $filter) {
            // 去掉默认的id过滤器
            $filter->disableIdFilter();
            $filter->like('name','楼层名称');
        });
    }
}
